import React from 'react';
import ReactDOM from 'react-dom';
import { WeaTools } from 'ecCom';
import WeaPlugin from './index.js';

(function () {
  if (WeaTools.ua.browser == 'IE') {
    WeaTools.callApi('/api/portal/systemInfo/getIsCheck', 'GET').then((result) => {
      const { data = {} } = result;
      if (data.isCheck) {
        const div = document.createElement('div');
        document.body.appendChild(div);
        ReactDOM.render(<WeaPlugin ecId={`${this && this.props && this.props.ecId || ''}_WeaPlugin@geuzvh`} visible={true} />, div);
      }
    });
  }
}());
